package hn.cch.microservice.configuration;


import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ribbon（负载均衡）配置：单独加载（不能在项目加载目录之内避免重复加载）
 */
@Configuration
public class RibbonConfiguration {

    @Bean
    public IRule ribbonRule(){
        //随机规则
        RandomRule randomRule = new RandomRule();
        return randomRule;
    }

}
